﻿using System;
using System.Windows.Forms;
using System.Collections.Generic;

using SBPweb.Modules.Smartparts;

namespace SBPweb.Presentation.Windows.Forms.Controls
{

    public class MenuItemControl : ToolStripMenuItem, IMenuItem
    {
        public MenuItemControl()
        {
            base.Click += new EventHandler(MenuItemControl_Click);
            base.MouseEnter += new EventHandler(MenuItemControl_MouseEnter);
        }

        void MenuItemControl_MouseEnter(object sender, EventArgs e)
        {
            if (Selected != null)
            {
                Selected(this, new MenuEventArgs(this));
            }
        }

        void MenuItemControl_Click(object sender, EventArgs e)
        {
            if (Pressed != null)
            {
                Pressed(this, new MenuEventArgs(this));
            }
        }

        #region IMenuItem Members

        public new event EventHandler<MenuEventArgs> Pressed;

        public new event EventHandler<MenuEventArgs> Selected;

        #endregion

    }

}